{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MegaFon Uplift Competition Dataset"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The dataset is provided by MegaFon at the [MegaFon Uplift Competition](https://ods.ai/competitions/megafon-df21-comp) hosted in may 2021.\n",
    "\n",
    "Here is a description of the fields:\n",
    "\n",
    "- **id** (int): client id\n",
    "\n",
    "- **treatment_group** (str): treatment/control group flag\n",
    "\n",
    "- **X_1...X_50** (float): feature values\n",
    "\n",
    "- **conversion** (binary): target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "\n",
    "# install uplift library scikit-uplift and other libraries \n",
    "!{sys.executable} -m pip install scikit-uplift dill lightgbm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklift.datasets import fetch_megafon\n",
    "import pandas as pd \n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "%matplotlib inline\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklift.models import TwoModels\n",
    "import lightgbm as lgb\n",
    "from sklift.metrics import qini_auc_score\n",
    "from sklift.viz import plot_qini_curve\n",
    "\n",
    "seed=31"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 📝 Load data\n",
    "\n",
    "Dataset can be loaded from `sklift.datasets` module using `fetch_megafon` function."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# returns sklearn Bunch object\n",
    "# with data, target, treatment keys\n",
    "# data features (pd.DataFrame), target (pd.Series), treatment (pd.Series) values \n",
    "\n",
    "dataset = fetch_megafon()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dataset type: <class 'sklearn.utils.Bunch'>\n",
      "\n",
      "Dataset features shape: (600000, 51)\n",
      "Dataset target shape: (600000,)\n",
      "Dataset treatment shape: (600000,)\n"
     ]
    }
   ],
   "source": [
    "print(f\"Dataset type: {type(dataset)}\\n\")\n",
    "print(f\"Dataset features shape: {dataset.data.shape}\")\n",
    "print(f\"Dataset target shape: {dataset.target.shape}\")\n",
    "print(f\"Dataset treatment shape: {dataset.treatment.shape}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 📝 EDA"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's have a look at the data features."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>X_1</th>\n",
       "      <th>X_2</th>\n",
       "      <th>X_3</th>\n",
       "      <th>X_4</th>\n",
       "      <th>X_5</th>\n",
       "      <th>X_6</th>\n",
       "      <th>X_7</th>\n",
       "      <th>X_8</th>\n",
       "      <th>X_9</th>\n",
       "      <th>...</th>\n",
       "      <th>X_41</th>\n",
       "      <th>X_42</th>\n",
       "      <th>X_43</th>\n",
       "      <th>X_44</th>\n",
       "      <th>X_45</th>\n",
       "      <th>X_46</th>\n",
       "      <th>X_47</th>\n",
       "      <th>X_48</th>\n",
       "      <th>X_49</th>\n",
       "      <th>X_50</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>39.396577</td>\n",
       "      <td>-0.186548</td>\n",
       "      <td>19.524505</td>\n",
       "      <td>21.250208</td>\n",
       "      <td>55.291264</td>\n",
       "      <td>182.966712</td>\n",
       "      <td>-5.385606</td>\n",
       "      <td>144.573379</td>\n",
       "      <td>-12.534344</td>\n",
       "      <td>...</td>\n",
       "      <td>90.877638</td>\n",
       "      <td>134.363458</td>\n",
       "      <td>-213.584582</td>\n",
       "      <td>-2.092461</td>\n",
       "      <td>-93.973258</td>\n",
       "      <td>-0.155597</td>\n",
       "      <td>-312.130733</td>\n",
       "      <td>44.798182</td>\n",
       "      <td>-125.682413</td>\n",
       "      <td>16.231365</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>38.987694</td>\n",
       "      <td>0.819522</td>\n",
       "      <td>-42.064512</td>\n",
       "      <td>-48.270949</td>\n",
       "      <td>-33.171257</td>\n",
       "      <td>179.459341</td>\n",
       "      <td>-87.151810</td>\n",
       "      <td>-162.693257</td>\n",
       "      <td>20.651652</td>\n",
       "      <td>...</td>\n",
       "      <td>-183.840746</td>\n",
       "      <td>72.864779</td>\n",
       "      <td>559.783584</td>\n",
       "      <td>1.142391</td>\n",
       "      <td>80.037124</td>\n",
       "      <td>-1.216185</td>\n",
       "      <td>-111.473936</td>\n",
       "      <td>-127.737977</td>\n",
       "      <td>-117.501171</td>\n",
       "      <td>10.732234</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>-16.693093</td>\n",
       "      <td>1.844558</td>\n",
       "      <td>-8.615192</td>\n",
       "      <td>-18.818740</td>\n",
       "      <td>-22.271188</td>\n",
       "      <td>-116.290369</td>\n",
       "      <td>-63.816746</td>\n",
       "      <td>-38.340763</td>\n",
       "      <td>24.968496</td>\n",
       "      <td>...</td>\n",
       "      <td>-203.637766</td>\n",
       "      <td>2.480242</td>\n",
       "      <td>96.998504</td>\n",
       "      <td>1.100962</td>\n",
       "      <td>-33.275159</td>\n",
       "      <td>0.920926</td>\n",
       "      <td>-679.492242</td>\n",
       "      <td>-91.009397</td>\n",
       "      <td>-18.173358</td>\n",
       "      <td>14.367636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>-72.040154</td>\n",
       "      <td>-0.226921</td>\n",
       "      <td>39.802607</td>\n",
       "      <td>16.441262</td>\n",
       "      <td>-1.112509</td>\n",
       "      <td>68.128008</td>\n",
       "      <td>23.073147</td>\n",
       "      <td>4.688858</td>\n",
       "      <td>-49.383641</td>\n",
       "      <td>...</td>\n",
       "      <td>172.906875</td>\n",
       "      <td>83.951551</td>\n",
       "      <td>-323.642557</td>\n",
       "      <td>-0.369182</td>\n",
       "      <td>93.221948</td>\n",
       "      <td>-1.962380</td>\n",
       "      <td>-442.466684</td>\n",
       "      <td>-22.298302</td>\n",
       "      <td>-75.916603</td>\n",
       "      <td>11.634299</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>18.296973</td>\n",
       "      <td>0.996437</td>\n",
       "      <td>24.465307</td>\n",
       "      <td>-34.151971</td>\n",
       "      <td>24.623458</td>\n",
       "      <td>-155.455558</td>\n",
       "      <td>-12.159787</td>\n",
       "      <td>26.705778</td>\n",
       "      <td>105.864805</td>\n",
       "      <td>...</td>\n",
       "      <td>125.577535</td>\n",
       "      <td>-208.531112</td>\n",
       "      <td>118.902324</td>\n",
       "      <td>-0.808578</td>\n",
       "      <td>-117.497906</td>\n",
       "      <td>1.770635</td>\n",
       "      <td>627.395611</td>\n",
       "      <td>122.019189</td>\n",
       "      <td>194.091195</td>\n",
       "      <td>-11.883858</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>599995</th>\n",
       "      <td>599995</td>\n",
       "      <td>33.031482</td>\n",
       "      <td>0.584463</td>\n",
       "      <td>-25.546737</td>\n",
       "      <td>-35.129322</td>\n",
       "      <td>6.603716</td>\n",
       "      <td>-90.384229</td>\n",
       "      <td>-44.399223</td>\n",
       "      <td>71.343628</td>\n",
       "      <td>26.439937</td>\n",
       "      <td>...</td>\n",
       "      <td>-183.820274</td>\n",
       "      <td>-167.259176</td>\n",
       "      <td>531.793092</td>\n",
       "      <td>-2.307605</td>\n",
       "      <td>-48.648490</td>\n",
       "      <td>0.763070</td>\n",
       "      <td>152.501250</td>\n",
       "      <td>-49.190995</td>\n",
       "      <td>149.292732</td>\n",
       "      <td>-15.031430</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>599996</th>\n",
       "      <td>599996</td>\n",
       "      <td>-24.469552</td>\n",
       "      <td>1.175070</td>\n",
       "      <td>35.936859</td>\n",
       "      <td>19.577711</td>\n",
       "      <td>81.505532</td>\n",
       "      <td>-164.141125</td>\n",
       "      <td>-8.221423</td>\n",
       "      <td>38.864814</td>\n",
       "      <td>-2.410108</td>\n",
       "      <td>...</td>\n",
       "      <td>103.792521</td>\n",
       "      <td>-87.706751</td>\n",
       "      <td>-230.298393</td>\n",
       "      <td>0.267790</td>\n",
       "      <td>-56.102467</td>\n",
       "      <td>-1.007702</td>\n",
       "      <td>-69.854583</td>\n",
       "      <td>187.924882</td>\n",
       "      <td>109.642972</td>\n",
       "      <td>25.022399</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>599997</th>\n",
       "      <td>599997</td>\n",
       "      <td>-57.592800</td>\n",
       "      <td>1.033326</td>\n",
       "      <td>-20.608920</td>\n",
       "      <td>87.116236</td>\n",
       "      <td>-27.894756</td>\n",
       "      <td>120.864975</td>\n",
       "      <td>40.592090</td>\n",
       "      <td>-34.134983</td>\n",
       "      <td>-26.821810</td>\n",
       "      <td>...</td>\n",
       "      <td>-97.993743</td>\n",
       "      <td>170.942462</td>\n",
       "      <td>299.211339</td>\n",
       "      <td>-0.930181</td>\n",
       "      <td>168.767350</td>\n",
       "      <td>-0.004762</td>\n",
       "      <td>-249.073528</td>\n",
       "      <td>-265.077308</td>\n",
       "      <td>-110.317964</td>\n",
       "      <td>-11.892925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>599998</th>\n",
       "      <td>599998</td>\n",
       "      <td>-16.371510</td>\n",
       "      <td>-0.876885</td>\n",
       "      <td>-1.483559</td>\n",
       "      <td>32.407631</td>\n",
       "      <td>-57.148865</td>\n",
       "      <td>92.559125</td>\n",
       "      <td>-21.464004</td>\n",
       "      <td>-110.615734</td>\n",
       "      <td>58.100487</td>\n",
       "      <td>...</td>\n",
       "      <td>-17.409713</td>\n",
       "      <td>108.897052</td>\n",
       "      <td>223.509177</td>\n",
       "      <td>-0.832695</td>\n",
       "      <td>5.545312</td>\n",
       "      <td>0.659149</td>\n",
       "      <td>-156.605507</td>\n",
       "      <td>-41.757924</td>\n",
       "      <td>-89.330302</td>\n",
       "      <td>-22.886739</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>599999</th>\n",
       "      <td>599999</td>\n",
       "      <td>62.997565</td>\n",
       "      <td>-1.299755</td>\n",
       "      <td>-9.485073</td>\n",
       "      <td>4.682186</td>\n",
       "      <td>64.339233</td>\n",
       "      <td>-14.527508</td>\n",
       "      <td>-113.750106</td>\n",
       "      <td>195.634148</td>\n",
       "      <td>104.627105</td>\n",
       "      <td>...</td>\n",
       "      <td>-64.312678</td>\n",
       "      <td>48.114939</td>\n",
       "      <td>-231.497127</td>\n",
       "      <td>-0.022551</td>\n",
       "      <td>7.373350</td>\n",
       "      <td>0.213328</td>\n",
       "      <td>-235.624729</td>\n",
       "      <td>39.129831</td>\n",
       "      <td>-47.422068</td>\n",
       "      <td>-21.564626</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 51 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            id        X_1       X_2        X_3        X_4        X_5  \\\n",
       "0            0  39.396577 -0.186548  19.524505  21.250208  55.291264   \n",
       "1            1  38.987694  0.819522 -42.064512 -48.270949 -33.171257   \n",
       "2            2 -16.693093  1.844558  -8.615192 -18.818740 -22.271188   \n",
       "3            3 -72.040154 -0.226921  39.802607  16.441262  -1.112509   \n",
       "4            4  18.296973  0.996437  24.465307 -34.151971  24.623458   \n",
       "599995  599995  33.031482  0.584463 -25.546737 -35.129322   6.603716   \n",
       "599996  599996 -24.469552  1.175070  35.936859  19.577711  81.505532   \n",
       "599997  599997 -57.592800  1.033326 -20.608920  87.116236 -27.894756   \n",
       "599998  599998 -16.371510 -0.876885  -1.483559  32.407631 -57.148865   \n",
       "599999  599999  62.997565 -1.299755  -9.485073   4.682186  64.339233   \n",
       "\n",
       "               X_6         X_7         X_8         X_9  ...        X_41  \\\n",
       "0       182.966712   -5.385606  144.573379  -12.534344  ...   90.877638   \n",
       "1       179.459341  -87.151810 -162.693257   20.651652  ... -183.840746   \n",
       "2      -116.290369  -63.816746  -38.340763   24.968496  ... -203.637766   \n",
       "3        68.128008   23.073147    4.688858  -49.383641  ...  172.906875   \n",
       "4      -155.455558  -12.159787   26.705778  105.864805  ...  125.577535   \n",
       "599995  -90.384229  -44.399223   71.343628   26.439937  ... -183.820274   \n",
       "599996 -164.141125   -8.221423   38.864814   -2.410108  ...  103.792521   \n",
       "599997  120.864975   40.592090  -34.134983  -26.821810  ...  -97.993743   \n",
       "599998   92.559125  -21.464004 -110.615734   58.100487  ...  -17.409713   \n",
       "599999  -14.527508 -113.750106  195.634148  104.627105  ...  -64.312678   \n",
       "\n",
       "              X_42        X_43      X_44        X_45      X_46        X_47  \\\n",
       "0       134.363458 -213.584582 -2.092461  -93.973258 -0.155597 -312.130733   \n",
       "1        72.864779  559.783584  1.142391   80.037124 -1.216185 -111.473936   \n",
       "2         2.480242   96.998504  1.100962  -33.275159  0.920926 -679.492242   \n",
       "3        83.951551 -323.642557 -0.369182   93.221948 -1.962380 -442.466684   \n",
       "4      -208.531112  118.902324 -0.808578 -117.497906  1.770635  627.395611   \n",
       "599995 -167.259176  531.793092 -2.307605  -48.648490  0.763070  152.501250   \n",
       "599996  -87.706751 -230.298393  0.267790  -56.102467 -1.007702  -69.854583   \n",
       "599997  170.942462  299.211339 -0.930181  168.767350 -0.004762 -249.073528   \n",
       "599998  108.897052  223.509177 -0.832695    5.545312  0.659149 -156.605507   \n",
       "599999   48.114939 -231.497127 -0.022551    7.373350  0.213328 -235.624729   \n",
       "\n",
       "              X_48        X_49       X_50  \n",
       "0        44.798182 -125.682413  16.231365  \n",
       "1      -127.737977 -117.501171  10.732234  \n",
       "2       -91.009397  -18.173358  14.367636  \n",
       "3       -22.298302  -75.916603  11.634299  \n",
       "4       122.019189  194.091195 -11.883858  \n",
       "599995  -49.190995  149.292732 -15.031430  \n",
       "599996  187.924882  109.642972  25.022399  \n",
       "599997 -265.077308 -110.317964 -11.892925  \n",
       "599998  -41.757924  -89.330302 -22.886739  \n",
       "599999   39.129831  -47.422068 -21.564626  \n",
       "\n",
       "[10 rows x 51 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataset.data.head().append(dataset.data.tail())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>X_1</th>\n",
       "      <th>X_2</th>\n",
       "      <th>X_3</th>\n",
       "      <th>X_4</th>\n",
       "      <th>X_5</th>\n",
       "      <th>X_6</th>\n",
       "      <th>X_7</th>\n",
       "      <th>X_8</th>\n",
       "      <th>X_9</th>\n",
       "      <th>...</th>\n",
       "      <th>X_41</th>\n",
       "      <th>X_42</th>\n",
       "      <th>X_43</th>\n",
       "      <th>X_44</th>\n",
       "      <th>X_45</th>\n",
       "      <th>X_46</th>\n",
       "      <th>X_47</th>\n",
       "      <th>X_48</th>\n",
       "      <th>X_49</th>\n",
       "      <th>X_50</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>...</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "      <td>600000.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>299999.500000</td>\n",
       "      <td>-3.758503</td>\n",
       "      <td>0.000405</td>\n",
       "      <td>0.356208</td>\n",
       "      <td>-1.004378</td>\n",
       "      <td>3.376919</td>\n",
       "      <td>-6.396371</td>\n",
       "      <td>-2.253712</td>\n",
       "      <td>-6.432606</td>\n",
       "      <td>-0.061507</td>\n",
       "      <td>...</td>\n",
       "      <td>6.882868</td>\n",
       "      <td>-6.632834</td>\n",
       "      <td>8.454493</td>\n",
       "      <td>0.001296</td>\n",
       "      <td>0.007967</td>\n",
       "      <td>-0.000966</td>\n",
       "      <td>-22.259600</td>\n",
       "      <td>-5.759041</td>\n",
       "      <td>6.241130</td>\n",
       "      <td>-1.176456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>173205.225094</td>\n",
       "      <td>54.881882</td>\n",
       "      <td>0.999419</td>\n",
       "      <td>31.804123</td>\n",
       "      <td>45.291429</td>\n",
       "      <td>53.397644</td>\n",
       "      <td>140.873734</td>\n",
       "      <td>59.810396</td>\n",
       "      <td>74.840857</td>\n",
       "      <td>44.912292</td>\n",
       "      <td>...</td>\n",
       "      <td>163.776538</td>\n",
       "      <td>137.025868</td>\n",
       "      <td>262.840194</td>\n",
       "      <td>1.000368</td>\n",
       "      <td>71.553713</td>\n",
       "      <td>0.999902</td>\n",
       "      <td>500.900364</td>\n",
       "      <td>130.952113</td>\n",
       "      <td>141.211999</td>\n",
       "      <td>21.363662</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>-271.659497</td>\n",
       "      <td>-4.372119</td>\n",
       "      <td>-148.870768</td>\n",
       "      <td>-244.446728</td>\n",
       "      <td>-302.574049</td>\n",
       "      <td>-683.126343</td>\n",
       "      <td>-322.731683</td>\n",
       "      <td>-506.202937</td>\n",
       "      <td>-218.466369</td>\n",
       "      <td>...</td>\n",
       "      <td>-810.842593</td>\n",
       "      <td>-633.575178</td>\n",
       "      <td>-1345.838757</td>\n",
       "      <td>-4.756720</td>\n",
       "      <td>-360.713742</td>\n",
       "      <td>-4.516004</td>\n",
       "      <td>-2506.960013</td>\n",
       "      <td>-687.526201</td>\n",
       "      <td>-702.184241</td>\n",
       "      <td>-98.094323</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>149999.750000</td>\n",
       "      <td>-40.693313</td>\n",
       "      <td>-0.673108</td>\n",
       "      <td>-20.758308</td>\n",
       "      <td>-30.644608</td>\n",
       "      <td>-31.865404</td>\n",
       "      <td>-100.762161</td>\n",
       "      <td>-42.313674</td>\n",
       "      <td>-54.840796</td>\n",
       "      <td>-30.327330</td>\n",
       "      <td>...</td>\n",
       "      <td>-102.658380</td>\n",
       "      <td>-99.033996</td>\n",
       "      <td>-167.634846</td>\n",
       "      <td>-0.673780</td>\n",
       "      <td>-48.250836</td>\n",
       "      <td>-0.675549</td>\n",
       "      <td>-357.547278</td>\n",
       "      <td>-93.163915</td>\n",
       "      <td>-88.803657</td>\n",
       "      <td>-15.580688</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>299999.500000</td>\n",
       "      <td>-3.954771</td>\n",
       "      <td>0.000915</td>\n",
       "      <td>0.372583</td>\n",
       "      <td>-0.585368</td>\n",
       "      <td>3.720738</td>\n",
       "      <td>-6.357443</td>\n",
       "      <td>-2.263690</td>\n",
       "      <td>-6.416419</td>\n",
       "      <td>-0.103742</td>\n",
       "      <td>...</td>\n",
       "      <td>7.190600</td>\n",
       "      <td>-6.784760</td>\n",
       "      <td>8.773280</td>\n",
       "      <td>0.001639</td>\n",
       "      <td>0.045537</td>\n",
       "      <td>-0.002251</td>\n",
       "      <td>-20.695017</td>\n",
       "      <td>-5.774627</td>\n",
       "      <td>6.286783</td>\n",
       "      <td>-1.199895</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>449999.250000</td>\n",
       "      <td>33.174835</td>\n",
       "      <td>0.673056</td>\n",
       "      <td>21.495530</td>\n",
       "      <td>29.027860</td>\n",
       "      <td>38.988940</td>\n",
       "      <td>88.159514</td>\n",
       "      <td>37.709780</td>\n",
       "      <td>41.962767</td>\n",
       "      <td>30.144501</td>\n",
       "      <td>...</td>\n",
       "      <td>116.755600</td>\n",
       "      <td>85.621324</td>\n",
       "      <td>185.382370</td>\n",
       "      <td>0.675779</td>\n",
       "      <td>48.221733</td>\n",
       "      <td>0.673638</td>\n",
       "      <td>313.295748</td>\n",
       "      <td>81.636824</td>\n",
       "      <td>101.558007</td>\n",
       "      <td>13.230410</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>599999.000000</td>\n",
       "      <td>250.812280</td>\n",
       "      <td>5.062006</td>\n",
       "      <td>170.053291</td>\n",
       "      <td>235.095937</td>\n",
       "      <td>284.915947</td>\n",
       "      <td>656.482242</td>\n",
       "      <td>293.909622</td>\n",
       "      <td>550.525780</td>\n",
       "      <td>219.628423</td>\n",
       "      <td>...</td>\n",
       "      <td>867.086690</td>\n",
       "      <td>689.626208</td>\n",
       "      <td>1488.759454</td>\n",
       "      <td>4.727996</td>\n",
       "      <td>384.665348</td>\n",
       "      <td>5.086304</td>\n",
       "      <td>2534.503855</td>\n",
       "      <td>595.321844</td>\n",
       "      <td>630.727101</td>\n",
       "      <td>112.233293</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8 rows × 51 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  id            X_1            X_2            X_3  \\\n",
       "count  600000.000000  600000.000000  600000.000000  600000.000000   \n",
       "mean   299999.500000      -3.758503       0.000405       0.356208   \n",
       "std    173205.225094      54.881882       0.999419      31.804123   \n",
       "min         0.000000    -271.659497      -4.372119    -148.870768   \n",
       "25%    149999.750000     -40.693313      -0.673108     -20.758308   \n",
       "50%    299999.500000      -3.954771       0.000915       0.372583   \n",
       "75%    449999.250000      33.174835       0.673056      21.495530   \n",
       "max    599999.000000     250.812280       5.062006     170.053291   \n",
       "\n",
       "                 X_4            X_5            X_6            X_7  \\\n",
       "count  600000.000000  600000.000000  600000.000000  600000.000000   \n",
       "mean       -1.004378       3.376919      -6.396371      -2.253712   \n",
       "std        45.291429      53.397644     140.873734      59.810396   \n",
       "min      -244.446728    -302.574049    -683.126343    -322.731683   \n",
       "25%       -30.644608     -31.865404    -100.762161     -42.313674   \n",
       "50%        -0.585368       3.720738      -6.357443      -2.263690   \n",
       "75%        29.027860      38.988940      88.159514      37.709780   \n",
       "max       235.095937     284.915947     656.482242     293.909622   \n",
       "\n",
       "                 X_8            X_9  ...           X_41           X_42  \\\n",
       "count  600000.000000  600000.000000  ...  600000.000000  600000.000000   \n",
       "mean       -6.432606      -0.061507  ...       6.882868      -6.632834   \n",
       "std        74.840857      44.912292  ...     163.776538     137.025868   \n",
       "min      -506.202937    -218.466369  ...    -810.842593    -633.575178   \n",
       "25%       -54.840796     -30.327330  ...    -102.658380     -99.033996   \n",
       "50%        -6.416419      -0.103742  ...       7.190600      -6.784760   \n",
       "75%        41.962767      30.144501  ...     116.755600      85.621324   \n",
       "max       550.525780     219.628423  ...     867.086690     689.626208   \n",
       "\n",
       "                X_43           X_44           X_45           X_46  \\\n",
       "count  600000.000000  600000.000000  600000.000000  600000.000000   \n",
       "mean        8.454493       0.001296       0.007967      -0.000966   \n",
       "std       262.840194       1.000368      71.553713       0.999902   \n",
       "min     -1345.838757      -4.756720    -360.713742      -4.516004   \n",
       "25%      -167.634846      -0.673780     -48.250836      -0.675549   \n",
       "50%         8.773280       0.001639       0.045537      -0.002251   \n",
       "75%       185.382370       0.675779      48.221733       0.673638   \n",
       "max      1488.759454       4.727996     384.665348       5.086304   \n",
       "\n",
       "                X_47           X_48           X_49           X_50  \n",
       "count  600000.000000  600000.000000  600000.000000  600000.000000  \n",
       "mean      -22.259600      -5.759041       6.241130      -1.176456  \n",
       "std       500.900364     130.952113     141.211999      21.363662  \n",
       "min     -2506.960013    -687.526201    -702.184241     -98.094323  \n",
       "25%      -357.547278     -93.163915     -88.803657     -15.580688  \n",
       "50%       -20.695017      -5.774627       6.286783      -1.199895  \n",
       "75%       313.295748      81.636824     101.558007      13.230410  \n",
       "max      2534.503855     595.321844     630.727101     112.233293  \n",
       "\n",
       "[8 rows x 51 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataset.data.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "float64    50\n",
       "int64       1\n",
       "dtype: int64"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataset.data.dtypes.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number NA: 0\n"
     ]
    }
   ],
   "source": [
    "print('Number NA:', dataset.data.isna().sum().sum())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are 51 columns in the dataset: 50 feature values are float and id is integer. The dataset has no missing values."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  Target and treatment "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Also take a look at target and treatment."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x7f15a65c8c10>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAEHCAYAAABiAAtOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAXl0lEQVR4nO3df/BddX3n8efLAGqryK/I0gQMq+mMwVXUFOja3aWwA8GZbagFC7s1qWUmjgtt3dGu2OksVGVHt1Wm+IMpLpFArYhYIDqxMRtR1yqQoJEkUMp30ZUIC8FERF3R4Hv/uJ/vcvPN/X7zJZx7v+Sb52PmzD3nfT7ncz43uZNXzo97bqoKSZK69JyZHoAkafYxXCRJnTNcJEmdM1wkSZ0zXCRJnTNcJEmdO2imB/BscdRRR9WCBQtmehiStF+58847H62quRPrhkuzYMECNm7cONPDkKT9SpL/PajuaTFJUucMF0lS5wwXSVLnDBdJUucMF0lS54YWLkmel+SOJN9KsjXJn7f68UluT3Jfkk8lOa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25vUgccHV0qzUJIXVNWP2pHLTcDKqrqpg34X0PuF0Vc80740u3laTJqdLm1HHVuAbwM3z/B4dIDxyEXajyW5nd4tzP3eVFWbZ2I80jjDRZLUOU+LSZI6Z7hIkjpnuEiSOme4SJI6Z7hIkjpnuEiSOvf/AMXxfBUuReu2AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(x=dataset.treatment)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "treatment    300368\n",
       "control      299632\n",
       "Name: treatment_group, dtype: int64"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataset.treatment.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x7f15a42bb5d0>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAEKCAYAAADenhiQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAATLUlEQVR4nO3df6xf9X3f8ecrdkiyrJRfDqM21Gj1pjppQ4ND2LJuHVRgaFejLmSgdrYyq64Q6VJ16kpWqWzJ0IKSLStdioaCi50mdVC6FC9z4lgOJKoSfpiG8nMZd6QLlllsYkJJs5BC3vvj+zF8c/2919c3n+/32tfPh/TV95z3+Zzz+VyEeHHO+ZzzTVUhSVJPr1joAUiSFh/DRZLUneEiSerOcJEkdWe4SJK6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LevK1O5IAw0UdVdULwKHX7jwG3O5rd3SsSPJHwJeAv5tkb5KNCz2mxcwn9CVJ3XnmIknqznCRJHVnuEiSujNcJEndGS6SpO4MF2mRSfJhXxiqheZUZOk4lGRJVb240OOQZuKZizRPSdYneTDJnyf5SJIfTbK71XYnOae1uy3JTUm+mOSJJG9r9Y8nuXzoeLcl+adJliR5f5L72rF+tW3/mSR3JvkY8FCS1yb5H63/h5P8s9buriRr2vLVSR5q228c6utbSW5o+96d5MwJ/qPTCcBwkeYhyeuB3wYuqqo3Au8C/guwtap+EvgocNPQLmcB/wD4eeB9rbYNOBQIJwEXAzuAjcCzVfVm4M3AryQ5t+1zAfDbVbWawW+T7KuqN1bVG4DPTBvjjwA3AhcB5wFvTnJF2/xa4O429i8Av/KD/1ORXma4SPNzEfCJqnoaoKoOAn8P+Fjb/hEGYXLIn1TV96rqUeDQWcKngYuSvIrBD6x9oar+H3AJsD7JA8A9wOnAqrbPvVX11bb8EPCzSW5M8tNV9ey0Mb4ZuKuqDrRX83wU+Idt23eBT7Xl+4GV8/0HIY1iuEjzE478cwLD25+fti9V9R3gLuBSBmcw24a2/1pVndc+51bVZ9u2v3rp4FX/CzifQcj8hyS/M2KMM/nrevmG64vA0iP8LdJRMVyk+dkNvD3J6QBJTgO+yOBN0AC/BPzpHI6zDXgH8NMMXvhJ+74mySvbsf9OktdO37Fd9vp2Vf0h8AHgTdOa3AP8oyRntJ+gvhr4/Nz/RGn+/L8VaR6q6pEkNwCfT/Ii8GXgXwKbk/wmcIBBaBzJZ4GtwPb209AAH2ZwmerPkqQd64oR+/4E8P4k3wP+Grhm2hifSvJu4E4GZzE7quqOo/tLpflxKrIkqTsvi0mSujNcJEndGS6SpO4MF0lSd4aLJKk7w0WS1J3hIknqznCRJHX3/wEqUr2bAF6klgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(x=dataset.target)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    477486\n",
       "1    122514\n",
       "Name: conversion, dtype: int64"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataset.target.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>conversion</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>treatment_group</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>control</th>\n",
       "      <td>0.820600</td>\n",
       "      <td>0.179400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>treatment</th>\n",
       "      <td>0.771081</td>\n",
       "      <td>0.228919</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "conversion              0         1\n",
       "treatment_group                    \n",
       "control          0.820600  0.179400\n",
       "treatment        0.771081  0.228919"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.crosstab(dataset.treatment, dataset.target, normalize='index')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As we can see, the target is not balanced."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Simple baseline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Convert the **treatment** to binary values."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "dataset.treatment.loc[dataset.treatment == 'treatment'] = 1\n",
    "dataset.treatment.loc[dataset.treatment == 'control'] = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    300368\n",
       "0    299632\n",
       "Name: treatment_group, dtype: int64"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataset.treatment.value_counts()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In a binary classification problem definition we stratify train set by splitting target `0/1` column. In uplift modeling we have two columns instead of one. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train shape: (420000, 51)\n",
      "Validation shape: (180000, 51)\n"
     ]
    }
   ],
   "source": [
    "stratify_cols = pd.concat([dataset.treatment, dataset.target], axis=1)\n",
    "\n",
    "X_train, X_val, trmnt_train, trmnt_val, y_train, y_val = train_test_split(\n",
    "    dataset.data,\n",
    "    dataset.treatment,\n",
    "    dataset.target,\n",
    "    stratify=stratify_cols,\n",
    "    test_size=0.3,\n",
    "    random_state=31\n",
    ")\n",
    "\n",
    "print(f\"Train shape: {X_train.shape}\")\n",
    "print(f\"Validation shape: {X_val.shape}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "treatment_model = lgb.LGBMClassifier(random_state=31)\n",
    "control_model = lgb.LGBMClassifier(random_state=31)\n",
    "tm = TwoModels(estimator_trmnt = treatment_model, estimator_ctrl = control_model, method='vanilla')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "tm = tm.fit(X_train, y_train, trmnt_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "uplift_tm = tm.predict(X_val)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Qini coefficient on full data: 0.2401\n"
     ]
    }
   ],
   "source": [
    "# AUQC = area under Qini curve = Qini coefficient\n",
    "auqc = qini_auc_score(y_val, uplift_tm, trmnt_val) \n",
    "print(f\"Qini coefficient on full data: {auqc:.4f}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgEAAAGSCAYAAAB6/BIRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nOzdd5xcdfX/8ddJsmTTe0jY3TSSzWwaASIBQi+B0ALYQClCbFgAxYKKIoL65edXrFjgKwqIFKWIFDEgAVQsoYM7CSHZhBRI7333/P743NmdbJ1sdvbOzryfj8c8ZubOnZmzKXvPPfdzPh9zd0RERKTwdIo7ABEREYmHkgAREZECpSRARESkQCkJEBERKVBKAkRERAqUkgAREZECpSRARESkQCkJEJEGzOyrZvZ/bb2viOQW02RBIoXHzD4CXAUcCGwEHgC+4u4b4oxLRNqXKgEiBcbMrgJuBL4I9AEOB0YAfzGzohhDa5KZdYk7BpF8pCRApICYWW/gOuCz7v5nd9/l7lXAB4CRwIei/b5pZr+NHo8wMzezi81siZmtNrOvpX1m7b5NfOdMM3vZzDaa2Vtmdmq0vcrMTmrsc9K+c5aZLQH+amZ/Nr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W1VVVZxxxhm8/vrrbRBl6ykJaAtbt8LixXDppbWbHn443E+dqipAHHbv3s2yZQsbXfhm8+YNtft169aTsrIKJk06njFjwnK2qRJ+7977qYQvUuC6devGy9HKRRdffDE333wzX/va12KOqu0oCWgL8+eH+7RBgV/+crifNQvNs55FW7duZvHieXu024VR+G/uUcLv338oZWUVnHjih/co4Y8YcYBK+CKSkSOOOIJXX30VgM2bNzNz5kzWrVvHrl27uOGGG5g5cyZVVVXMmDGDo446in/84x+UlJTwxz/+kW7duvHCCy9w6aWX0r17d4466qjaz92+fTuXXXYZc+fOpUuXLtx0000cf/zx/OY3v+Ghhx6iurqa119/nauuuoqdO3dy55130rVrVx577DH69++/Tz+TkoC2UK898JVXYN486NoVxo2LMa48EUr47zY6MO/dd9+u3S9Vwi8rSzBt2lmMHZtIK+H3obgYuuhfvEiHdOWVV9aekbeVyZMn88MMVyaqrq7mqaeeYtasWQAUFxfz4IMP0rt3b1avXs3hhx/OWdEy8m+++SZ33303t956Kx/4wAe4//77ueCCC7jkkkv4yU9+wrHHHssXv/jF2s+++eabAXjttddIJpNMnz6d+dHJ5euvv85LL73E9u3bGT16NDfeeCMvvfQSn/vc57jjjju48sor9+nPQL8S20IyGWrGY8YAcOGFYfOPfhRmEZbM7N69m+XLFzVY+KaqKsmmTetr9+vWrSelpQkmTDiWc8+tIJEIZ/WpEn7XrurEEJG2sW3bNiZPnkxVVRWHHnooJ598Mv+/vfsPjro+Ezj+fhJiIhjDL0FKAgSqJBFCUAoyFVFRQBrgLPTEcuipUwVOrcc4dyozjlo9bdG7HnNYS3v+qulBqlfK3JQSvVIRRgXhxB9NIOGnYARMIILyw+Bzf3w+u34TsiEJyW5293nNMNn97PfXs99l97PP97OfB9yXkwcffJC1a9eSkpLCvn372L9/PwC5ubkUFRUBcNlll7Fr1y7q6uo4fPgw48ePB2DOnDms8qPH161bx9133w1AXl4eAwcODHcCrr76ajIzM8nMzCQrK4upU6cCMHz48HBW4mxYJ6A9VFRAbi5kZP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JnXu1V1dfABEbkK+KIlB+uXvRYYq6pfishfcB/OAMdV9VRo0eY2A8xQ1a2Ntj2mhcuF4jEmKVkmwJgEoaq1QCmuiEvILuAyf3s6kNaGTf9ARFL8OIHBuOIvq4F54kpUIyIXi6veeCZfhdbBlX895DsAecDlEdapAAaLyCB//8bAY6uBu30HBxEZ6duPAJktWG4tMNu3DQMKWxCDMQnDOgHGJJangeCvBH4FjBeRDcAYWvgtvZGtwBvAKlzVtOPAr4G/AptF5EPgl7Qss7gUN3ahBPgT0EVE3gd+grskcBpVPQbMB/4kIuuA/UCdf/gnuI7N+/44fuLb1wAFoYGBzSz3C+A8fwz/hBtTYEzSsCqCxphOT0TOU9Wj/pv8EqBSVf8t1sdlTLyzTIAxJh78yA/q+wh3GeGXMT4eYxKCZQKMMcaYJGWZAGOMMSZJWSfAGGOMSVLWCTDGGGOSlHUCjDHGmCRlnQBjjDEmSVknwBhjjElS/w9fVoaKFJFhqgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 576x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# with ideal Qini curve (red line)\n",
    "# perfect=True\n",
    "\n",
    "plot_qini_curve(y_val, uplift_tm, trmnt_val, perfect=True);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
